{% load i18n admin_urls admin_static %}

{% load i18n %}
<!doctype html>
<!--[if IE]><![endif]-->
<!--[if lt IE 7 ]> <html lang="en" class="ie6">    <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="ie7">    <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="ie8">    <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="ie9">    <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en"><!--<![endif]-->
<head>
    <!--[if lt IE 9]>
    <script src="{{ STATIC_URL }}js/html5shiv.min.js"></script>
    <script src="{{ STATIC_URL }}js/respond.min.js"></script>
    <![endif]-->
    <meta charset="utf-8"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <script src="{% static "bower_components/jquery/dist/jquery.min.js" %}" type="text/javascript"></script>
    <link href="{% static "bower_components/bootstrap/dist/css/bootstrap.min.css" %}" rel="stylesheet" type="text/css"/>

    <script src="{% static "bower_components/bootstrap/dist/js/bootstrap.min.js" %}" type="text/javascript"></script>
    <script src="{% static "bower_components/underscore/underscore-min.js" %}" type="text/javascript"></script>

    <script src="{% static "bower_components/underscore/underscore-min.js" %}" type="text/javascript"></script>
    <script src="{% static "scripts/daw_client.js" %}" type="text/javascript"></script>
    <script type="text/javascript">
        {#        DawClient.GETTING_AVAILABLE_STATES_URI = "{% url 'daw.views.get_available_states' '$0' '$1' '$2'%}";#}
        DawClient.GETTING_CURRENT_STATE_URI = "{% url 'daw.views.get_current_state' '$0' '$1' '$2'%}".replace(/%24/g, '$');
        DawClient.APPROVE_TRANSITION_URI = "{% url 'daw.views.approve_transition_view' '$0' '$1' '$2' '$3' %}".replace(/%24/g, '$');
        DawClient.REJECT_TRANSITION_URI = "{% url 'daw.views.reject_transition_view' '$0' '$1' '$2' '$3' %}".replace(/%24/g, '$');
        DawClient.GET_STATE_BY_LABEL_URI = "{% url 'daw.views.get_state_by_label' '$0' %}".replace(/%24/g, '$');
        DawClient.SKIP_TRANSITION_URI = "{% url 'daw.views.skip_transition' '$0' '$1' '$2' %}".replace(/%24/g, '$');

        DawClient.registerProcessCallBack(DawClient.BEFORE_PROCESS, DawClient.getStateByLabel('s1').id, DawClient.getStateByLabel('s2').id, function (data) {
            alert('Before Done!');
            data.callback();
        });
        DawClient.registerProcessCallBack(DawClient.AFTER_PROCESS, DawClient.getStateByLabel('s1').id, DawClient.getStateByLabel('s2').id, function (data) {
            alert('After Done!');
            data.callback();
        });
    </script>

</head>

<body>
<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{% url "example_app.views.index" %}">DAW Example Application</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li>
                    {% trans 'On Approval Count' as on_approval_count_button_text %}{% url "example_app.views.on_approval_objects" as on_approval_objects_url %} {% daw_on_approval_count cls state_field on_approval_objects_url on_approval_count_button_text %}
                </li>
                <li>
                    <div>
                        {% trans "Welcome" %} {{ request.user }} <a href="{% url 'django.contrib.auth.views.logout_then_login' %}?next=/">{% trans "Logout" %}</a></div>
                </li>
            </ul>

        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container-fluid -->
</nav>

{% block content %}
{% endblock %}
</body>
</html>